//
//  TestAutoLayoutViewController.m
//  testSyntextApp
//
//  Created by MICHAEL on 15/7/31.
//  Copyright (c) 2015年 kyy. All rights reserved.
//

#import "TestAutoLayoutViewController.h"
#import "ViewController2.h"
@interface TestAutoLayoutViewController ()

@end

@implementation TestAutoLayoutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor whiteColor]];

    UIButton *button3=[[UIButton alloc]initWithFrame:CGRectMake(100, 140, 50, 50)];
    button3.backgroundColor=[UIColor redColor];
    [button3 addTarget:self action:@selector(gotonew) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button3];
//    UIButton *button1=[[UIButton alloc]init];
//    UIButton *button2=[[UIButton alloc]init];
//    [button1 setTitle:@"button1" forState:UIControlStateNormal];
//    [button2 setTitle:@"button2" forState:UIControlStateNormal];
//    [self.view addSubview:button1];
//     [self.view addSubview:button2];
//
//    NSDictionary *viewsDictionary =
//    NSDictionaryOfVariableBindings(button1, button2);
//    NSArray *constraints =
//    [NSLayoutConstraint constraintsWithVisualFormat:@"[button1]-11-[button2]"
//                                            options:0 metrics:nil views:viewsDictionary];


}
-(void)gotonew{
    ViewController2 *viewController=[[ViewController2 alloc]init];
    //self.navigationController.navigationBar.tintColor=[UIColor redColor];
    //self.navigationController.navigationBar.barTintColor=[UIColor redColor];
    self.navigationController.navigationBar.backgroundColor=[UIColor redColor];
    [self.navigationController pushViewController:viewController animated:YES];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
